package com.bsoft.mvpmy.ui;

import android.os.Bundle;
import android.widget.Button;

import com.bsoft.mvpmy.R;
import com.bsoft.mvpmy.base.BaseActivity;

import java.io.File;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.MediaType;
import okhttp3.RequestBody;

public class MainActivity extends BaseActivity<MainContract.Presenter> implements MainContract.View {

    @Bind(R.id.btn_file)
    Button btnFile;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example);
        ButterKnife.bind(this);
        initApi();
        this.createPresenter(new MainPresenter(this));

    }


    @OnClick(R.id.btn_file)
    public void onClick() {
        String path = "file:///android_asset/index.txt";
        File f = new File(path);
        RequestBody requestBody1 = RequestBody.create(MediaType.parse("multipart/form-data"), f);
        presenter.fastdidata(requestBody1);

    }

    @Override
    public void fastdiSuccess() {

    }

    @Override
    public void hideLoading() {

    }
}
